Skip to content

Handle unregistered template changes gracefully#231

Open
oiahoon wants to merge 2 commits into
WebCoder49:mainfrom
oiahoon:fix/unregistered-template-recovery
Open

Handle unregistered template changes gracefully#231
oiahoon wants to merge 2 commits into
WebCoder49:mainfrom
oiahoon:fix/unregistered-template-recovery

Conversation

@oiahoon

@oiahoon oiahoon commented Jul 16, 2026

Copy link
Copy Markdown

Summary

  • keep loaded editors editable by returning to the existing fallback display when their template name is unregistered
  • resume highlighting when the requested template is registered and release stale waiting-queue entries
  • cover missing, stale, recovered, and subsequent registered-template transitions

Fixes #227

Testing

  • Prism browser test page: all tests passed
  • Highlight.js browser test page: all tests passed
  • node --check code-input.js
  • node --check tests/tester.js
  • git diff --check

@WebCoder49

Copy link
Copy Markdown
Owner

Thanks for testing! Unfortunately I won't be able to review this until after EMF2026 and then work, next Monday at the very earliest. I hope that's fine since you don't use code-input.js.

@WebCoder49

Copy link
Copy Markdown
Owner

Thanks! I've looked through your code and it makes a lot of sense (though I have a few suggestions I'll commit, and questions I'll put here).

One problem is that changing the template via DevTools of a dark mode code-input element (for example prism-dark.css rather than prism.css, or dark.css rather than default.css for highlight.js) to an unregistered name keeps the text white. If you want to manually test or fix this that would be great; I'll also look into it (it's to do with the colours set in internalStyle).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting invalid template name on already-registered code-input element should be treated more graciously

2 participants